<div class="widget">
	<div class="widgetTitle">
		<h3>
			<?= $title; ?>
		</h3>
	</div>

	<div class="widgetContent bottom-border">
		<div class="row nomargin">
			<div class="col-md-12 col-sm-12 col-xs-12">
				<p class="block text-muted clearfix">Please provide correct
					information of your Business and Services, we have full right to
					delete your post anytime without prior intimation.</p>

				<?php if (Session::get('message')) { ?>
				<p class="block clearfix text-red">
					<i class="fa fa-exclamation-circle fa-2x pull-left "></i>
					<?= Session::get('message'); ?>
				</p>
				<?php } ?>



				<form class="form-horizontal" method="post"
					action="<?= URL::current(); ?>" accept-charset="UTF-8">

					<legend>Login Information</legend>

					<div class="form-group">
						<label class="col-sm-2 control-label">User Name <span
							class="text-red"> * </span>
						</label>
						<div class="col-sm-8">
							<span class="text text-danger"><?php echo $errors->first('user_name') ?></span>
							<input type="text" name="user_name" id="user_name" class="field"
								 value="<?= $user->username; ?>">
						</div>
					
					</div>

					<div class="form-group">
						<label class="col-sm-2 control-label">Email <span class="text-red">
								* </span>
						</label>
						<div class="col-sm-8">
								<input type="text" name="email" id="email" class="field"
								disabled="disabled" value="<?= $user->email; ?>" readonly>
						</div>
						
					</div>

					<?php if($errors->first('password') == $errors->first('password_confirm')){?>
					<div class="form-group">
						<label class="col-sm-2 control-label"></label>
						<div class="col-sm-8">
							<input data-target="#change-password" data-toggle="collapse"
								id="changepasswordcheck" value="option1" type="checkbox"> Change
							password?

						</div>
					</div>

					<div class="collapse" id="change-password">

						<div class="form-group">
							<label class="col-sm-2 control-label">Password <span
								class="text-red"> * </span>
							</label>
							<div class="col-sm-8">
							<span class="text text-danger">
								<?php echo $errors->first('password') ?>
						</span>
								<input class="field" name="password" id="password"
									placeholder="Password" type="password"
									>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">Confirm Password <span
								class="text-red"> * </span>
							</label>
							<div class="col-sm-8">
							<span class="text text-danger">
								<?php echo $errors->first('password_confirm') ?>
						</span>
								<input class="field" name="password_confirm" id="password_confirm"
									placeholder="Password confirmation" type="password"
									>
							</div>
						</div>


					</div>
					<?php }?>
					<?php if($errors->first('password') != $errors->first('password_confirm')){?>
						
						<div class="form-group">
							<label class="col-sm-2 control-label">Password <span
								class="text-red"> * </span>
							</label>
							<div class="col-sm-8">
								<span class="text text-danger">
								<?php echo $errors->first('password') ?>
						</span>
								<input class="field" name="password" id="password"
									placeholder="Password" type="password"
									>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">Confirm Password <span
								class="text-red"> * </span>
							</label>
							<div class="col-sm-8">
							<span class="text text-danger">
								<?php echo $errors->first('password_confirm') ?>
						</span>
								<input class="field" name="password_confirm" id="password_confirm"
									placeholder="Password confirmation" type="password"
									>
							</div>
						

					</div>	
							<?php }?>

					<legend>Personal Information</legend>
					<div class="form-group">
						<label class="col-sm-2 control-label">Name <span class="text-red">
								* </span>
						</label>
						<div class="col-sm-8">
						<span class="text text-danger">
								<?php echo $errors->first('name') ?>
						</span>
							<input type="text" name="name" id="name" class="field"
								placeholder="Business Title" value="<?= $user->name; ?>">
							
							
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-2 control-label">Gender <span
							class="text-red"> * </span>
						</label>
						<div class="col-sm-8">
							<select name="category" class="parent field">
								<option value="<?= $user->gender;?>"
								<?php if($user->gender == "Male") echo "Selected='selected'"?>>Male</option>
								<option value="<?= $user->gender;?>"
								<?php if($user->gender == "Female") echo "Selected='selected'"?>>Female</option>

							</select>
						</div>
					</div>

					<div class="form-group widget-footer">
						<div class="col-sm-offset-2 col-sm-10">
							<input type="hidden" name="memID" id="memID" value="<?= $user->id;?>">
							<button type="submit" class="btn btn-success">Update</button>
						</div>

					</div>
				</form>

			</div>
		</div>
	</div>
</div>
